package hgz.stu.review.ruijie.config.resolve;

import org.springframework.core.io.support.ResourcePatternResolver;

import hgz.stu.review.ruijie.enviroment.SkyEngineEnvType;

/**
 * Description: Function Description
 * Copyright: Copyright (c) 2017
 * Company: Ruijie Co., Ltd.
 * Create Time: 2018/8/28
 *
 * @author dell
 */
public class ModuleConfigResolver extends AbstractConfigResolver {

    private String jarPath;

    public ModuleConfigResolver(ResourcePatternResolver resourceLoader, String jarPath) {
        super(resourceLoader);
        this.jarPath = jarPath;
    }

    @Override
    public boolean containsConfig() {
        return true;
    }

    @Override
    String buildLocation(SkyEngineEnvType skyEngineEnvType, String moduleName) {
        return jarPath+"/config/*-"+ skyEngineEnvType.toString().toLowerCase()+".properties";
    }

    @Override
    public int getOrder() {
        return 1;
    }

}